//
//  HRForgetPasswordViewModel.m
//  Hear
//
//  Created by mac on 2017/3/30.
//  Copyright © 2017年 mac. All rights reserved.
//

#import "HRForgetPasswordViewModel.h"
#import "HRRegisterModel.h"
@implementation HRForgetPasswordViewModel
- (void)forgetPasswordParam:(HRRegisterRequstModel *)paramDict andSeccess:(void(^)(BOOL seccess))seccess
{

    YTKApi *api = [YTKApi apiPutWithUrl:@"UserInfo/Put_ForgetUserPassword" parameter:paramDict];
    [api getSuccessToken:^() {
        [api setRequestSerializerType:YTKRequestSerializerTypeJSON];
        [api startWithCompletionBlockWithSuccess:^(__kindof YTKBaseRequest * _Nonnull request) {
            NSDictionary *dict = request.responseJSONObject;
            seccess(YES);
            DDLog(@"");
        } failure:^(__kindof YTKBaseRequest * _Nonnull request) {
            seccess(NO);
        }];
    }];
}


#pragma mark 绑定手机号
-(void)putBiningUserInfo:(NSDictionary *)requstDict isSeccess:(void(^)(BOOL isSeccess))isSeccess{
    YTKApi *api = [YTKApi apiPutWithUrl:@"UserInfo/Put_BindUserInfo" para:requstDict];
    [api getSuccessToken:^() {
        api.foceNoTocken = NO;
        [api setRequestSerializerType:YTKRequestSerializerTypeJSON];
        [api startWithCompletionBlockWithSuccess:^(__kindof YTKBaseRequest * _Nonnull request) {
            
            NSDictionary *dict = request.responseJSONObject;
            if ([dict[@"CodeStatus"] intValue] == 20000){
                isSeccess(YES);
            }else{
                isSeccess(NO);
            }
            // BodyContent
        } failure:^(__kindof YTKBaseRequest * _Nonnull request) {
            isSeccess(NO);
        }];
    }];
}
@end
